<?php

/************************************************************
This is the main web page for the DoDirectPayment sample.
This page allows the user to enter name, address, amount,
and credit card information. It also accept input variable
paymentType which becomes the value of the PAYMENTACTION
parameter.

When the user clicks the Submit button, DoDirectPaymentReceipt.php
is called.

Called by index.html.

Calls DoDirectPaymentReceipt.php.

************************************************************/
// clearing the session before starting new API Call


?>
<div id="content-wrapper-faq" class="corner">

<span class="titulo_seccion-faq">Credit Card<span class="color"> Payment</span></span>
<br><br>
<form method="POST" action="<?php echo url_for('invoices/confirmationCredit'); ?>" name="DoDirectPaymentForm">
<input type="hidden" name="paymentType" value="Authorization" />
<table width="550" align="center" cellpadding="5" cellspacing="0">
	<tr>
		<td>First Name:</td>
		<td><input type="text" size="30" maxlength="32" name="firstName" id="firstName" value="<?php echo $invoice->getBillingName(); ?>" ></td>
	</tr>
	<tr>
		<td>Last Name:</td>
		<td><input type="text" size="30" maxlength="32" name="lastName" id="lastName" value="<?php echo $invoice->getBillingLastName(); ?>" ></td>
	</tr>
	<tr>
		<td>Card Type:</td>
		<td>
			<select name="creditCardType" id="creditCardType" >
                                <option value="Visa" selected>Visa</option>
				<option value="MasterCard">MasterCard</option>
				<option value="Discover">Discover</option>
				<option value="Amex">American Express</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>Card Number:</td>
                <td align="left"><input type="text" size="19" maxlength="19" name="creditCardNumber" id="creditCardNumber" value="" onfocus="this.autocomplete='off';" ></td>
	</tr>
	<tr>
		<td>Expiration Date:</td>
		<td>
			<select name="expDateMonth" id="expDateMonth">
				<option value="1">01</option>
				<option value="2">02</option>
				<option value="3">03</option>
				<option value="4">04</option>
				<option value="5">05</option>
				<option value="6">06</option>
				<option value="7">07</option>
				<option value="8">08</option>
				<option value="9">09</option>
				<option value="10">10</option>
				<option value="11">11</option>
				<option value="12">12</option>
			</select>
			<select name="expDateYear" id="expDateYear">
				<option value="11">11</option>
				<option value="12">12</option>
				<option value="13">13</option>
				<option value="14">14</option>
				<option value="15">15</option>
				<option value="16">16</option>
				<option value="17">17</option>
				<option value="18">18</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>Card Verification Number:</td>
		<td><input type="text" size="3" maxlength="4" name="cvv2Number" id="cvv2Number" value="" onfocus="this.autocomplete='off';" ></td>
	</tr>

	<tr>
            <td align="center" colspan="2">
                    <input type="submit" value="Pay" onclick="return checkCheckoutCredit(this.form);" class="button-enter" />
        </tr>
        <tr>
        	<td colspan="2" style="border-bottom:1px solid #333;">&nbsp;</td>
        </tr>
        <tr>
		<td align="left" colspan="2" bgcolor="#999999"><br><b>Billing Address:</b></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">Address 1: <?php echo $invoice->getBillingAddress(); ?><input type="hidden" name="address1" value="<?php echo $invoice->getBillingAddress(); ?>"></td>
		<td bgcolor="#CCCCCC">City: <?php echo $invoice->getBillingCity(); ?><input type="hidden" name="city" value="<?php echo $invoice->getBillingCity(); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">State: <?php echo $invoice->getBillingState(); ?><input type="hidden" name="state" value="<?php echo $invoice->getBillingState(); ?>"></td>
		<td bgcolor="#CCCCCC">ZIP Code: <?php echo $invoice->getBillingZip(); ?><input type="hidden" name="zip" value="<?php echo $invoice->getBillingZip(); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">Email: <?php echo $invoice->getBillingEmail(); ?><input type="hidden" name="email" value="<?php echo $invoice->getBillingEmail(); ?>"></td>
		<td bgcolor="#CCCCCC">Phone: <?php echo $invoice->getBillingPhone(); ?><input type="hidden" name="phone" value="<?php echo $invoice->getBillingPhone(); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">Country: United States</td>
		<td bgcolor="#CCCCCC">Amount: <?php echo $invoice->getInvoiceAmount(); ?>  USD
                    <input type="hidden" name="amount" value="<?php echo $invoice->getInvoiceAmount(); ?>">
                    <input type="hidden" name="invnum" value="<?php echo $invoice->getIdInvoice(); ?>">
                    <input type="hidden" name="tax" value="<?php echo $invoice->getTaxAmount(); ?>">
                    <input type="hidden" name="shipping" value="<?php echo $invoice->getShippingAmount(); ?>"></td>
	</tr>
  
        <tr>
		<td align="left" colspan="2" bgcolor="#999999"><br><b>Shipping Address:</b></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">Address: <?php echo $invoice->getShippingAddress(); ?><input type="hidden" name="shipping_address" value="<?php echo $invoice->getShippingAddress(); ?>"></td>
		<td bgcolor="#CCCCCC">City: <?php echo $invoice->getShippingCity(); ?><input type="hidden" name="shipping_city" value="<?php echo $invoice->getShippingCity(); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">State: <?php echo $invoice->getShippingState(); ?><input type="hidden" name="shipping_state" value="<?php echo $invoice->getShippingState(); ?>"></td>
		<td bgcolor="#CCCCCC">ZIP Code: <?php echo $invoice->getShippingZip(); ?><input type="hidden" name="shipping_zip" value="<?php echo $invoice->getShippingZip(); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#CCCCCC">Country: United States</td>
        <td bgcolor="#CCCCCC">&nbsp;</td>
	</tr>


</table>
</form>
</div><br />

